package com.gxw.kotlint.ui.activity

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.RelativeLayout
import com.gxw.kotlint.R
import org.jetbrains.anko.backgroundColor
import org.jetbrains.anko.relativeLayout
import org.jetbrains.anko.textView
import org.jetbrains.anko.wrapContent

class ForthActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)


        relativeLayout({

            backgroundColor = getColor(R.color.theme_bg)

            var hello = textView("hello world") {
                id = R.id.tv_forth_f
            }.lparams(wrapContent, wrapContent)
            textView("ni hao") {
                //这是below
                var lp = RelativeLayout.LayoutParams(wrapContent, wrapContent)
                lp.addRule(RelativeLayout.BELOW, hello.id)
                layoutParams = lp
            }


        })


    }
}
